<!DOCTYPE html>
<html lang="en">
<head>
    <title>考勤签到</title>
    <meta http-equiv="pragma" content="no-cache">
    <meta http-equiv="Cache-Control" content="no-store, must-revalidate">
    <meta http-equiv="expires" content="Wed, 26 Feb 1997 08:21:57 GMT">
    <meta http-equiv="expires" content="-1">
    <meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no"
          name="viewport">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <link rel="shortcut icon" href="/dist/img/icon.png" type="image/x-icon">
    <!--字体-->
    <link rel="stylesheet" href="/dist/css/font-awesome.min.css">
    <link rel="stylesheet" href="/dist/css/ionicons.min.css">
    <link rel="stylesheet" href="//at.alicdn.com/t/font_855021_i2jfy4r0uq.css">
    <link rel="stylesheet" href="/dist/css/oa-app.css">
    <script src="https://file.ggxqce.com/web/vue.min.js"></script>
    <link rel="stylesheet" href="/dist/plugins/calendar/calendar.css"/>
</head>
<style>
    body, html {
        width: 100%;
        margin: 0;
        font-family: "微软雅黑";
    }

    #allmap, #allmap2 {
        /*width: 100%;*/
        height: 300px;
        overflow: hidden;
        margin: 0;
        font-family: "微软雅黑";
    }

    [v-cloak] {
        display: none;
    }

    * {
        -webkit-box-sizing: border-box;
        -moz-box-sizing: border-box;
        box-sizing: border-box;
        font-size: 12px;
    }

    body {
        margin: 1px;
        background: #ffffff;
    }

    .boxBoy {
        background: #fff;
    }

    table {
        border-spacing: 0;
        border-collapse: collapse;
        display: table;
    }

    .weather {
        text-align: center;
        font-size: 16px;
        /*position: absolute;*/
        top: 5px;
        line-height: 30px;
        float: left;
    }

    th {
        font-weight: normal;
    }

    table.text-center, table.text-center td, table.text-center th {
        text-align: center;
        font-size: 12px;
        margin-top: -1px;
    }

    .table-bordered > thead > tr > th, .table-bordered > tbody > tr > th, .table-bordered > tfoot > tr > th, .table-bordered > thead > tr > td, .table-bordered > tbody > tr > td, .table-bordered > tfoot > tr > td {
        border: 1px solid #cbcbcd;
        height: 28px;
        position: relative;
        color: #333;
        padding: 0 4px;
    }

    table th {
        background: #f8f8f8;
    }

    .table-bordered {
        border: 1px solid #cbcbcd;
    }

    .table {
        width: 100%;
        max-width: 100%;
    }

    .hidden {
        display: none;
    }

    .lineOne, .lineTwo {
        text-align: left;
    }

    .tdColor {
        background-color: #f8f8f8;
        font-weight: normal;
    }

    .lineOne span {
        max-height: 24px;
        line-height: 24px;
        overflow: hidden;
        text-overflow: ellipsis;
        display: -webkit-box;
        -webkit-box-orient: vertical;
        -webkit-line-clamp: 1;
        text-align: left;
    }

    .lineTwo span {
        max-height: 55px;
        line-height: 16px;
        overflow: hidden;
        text-overflow: ellipsis;
        display: -webkit-box;
        -webkit-box-orient: vertical;
        -webkit-line-clamp: 3;
        text-align: left;
        padding: 5px;

    }

    .div-td-content-more {
        position: absolute;
        height: auto;
        z-index: 999;
        line-height: 20px;
        background-color: #d3e8fd;
        padding: 8px 6px;
        border: 1px solid #e8e8ea;
        display: none;
    }

    .div-td-content-more i {
        width: 15px;
        height: 12px;
        background: url("/dist/img/more-icon.png");
        position: absolute;
        left: 50px;
        top: -12px;
    }

    .clear {
        clear: both
    }

    .boxItem {
        width: 100%;
        margin-top: 5px;
        background: inherit;
        /*background-color: rgba(255, 255, 255, 1);*/
        border: none;
        position: relative;
    }

    .boxItemTitle {
        color: #000;
        font-size: 22px;
        font-weight: bold;
        margin-bottom: 6px;
        text-align: center;
    }

    .home {
        font-size: 14px;
        font-weight: bold;
        margin-bottom: 10px;
        height: 14px;
        line-height: 14px;
        text-align: center;
    }

    .dian-icon {
        background: url("/dist/img/dian.png") no-repeat;
        background-size: cover;
        width: 14px;
        height: 14px;
        display: inline-block;
    }

    .jiaobiao, .jiaobiaoNew {
        position: relative;
    }

    .jiaobiao i {
        display: block;
        width: 0;
        height: 0;
        border-width: 0px 0 12px 12px;
        border-style: solid;
        border-color: transparent transparent transparent #2a8cec;
        position: absolute;
        top: 0px;
        left: 0px;
    }

    .jiaobiaoNew i {
        display: block;
        width: 12px;
        height: 12px;
        background: url("/dist/img/newLog2.png");
        background-size: 100% 100%;
        position: absolute;
        top: 0px;
        left: 0px;
    }

    .lineImg {
        padding-top: 5px !important;
        padding-bottom: 5px !important;
    }

    .lineImg img {
        height: 45px;
        width: 45px;
        float: left;
        margin: 10px;
        object-fit: cover;
    }

    .newCustomer {
        background: url(/dist/img/new.png) no-repeat;
        background-size: cover;
        width: 20px;
        height: 20px;
        right: 0;
        top: 2px;
        position: absolute;
    }

    .wajueji {
        padding-left: 140px;
        background: url("/dist/img/wajueji.png") no-repeat;
        background-size: 120px 88px;
        height: 88px;
        line-height: 88px;
        color: red;
        font-size: 14px;
        font-weight: bold;
        margin-left: 50px;
    }

    .qipao {
        /*background: url(/dist/img/qipao.png);*/
        background-size: 100% 100%;
        height: 88px;
        /* padding: 0 20px; */
        padding-left: 20px;
        /*padding-right: 20px;*/
        color: red;
        line-height: 88px;
        float: left;
        font-size: 14px;
        font-weight: bold;
    }

    .plan1 {
        background: url("/dist/img/plan1.png") no-repeat center center;
        background-size: 100%;
    }

    .plan2 {
        background: url("/dist/img/plan2.png") no-repeat center center;
        background-size: 100%;
    }

    .plan3 {
        background: url("/dist/img/plan3.png") no-repeat center center;
        background-size: 100%;
    }

    .boxItemTitleNotice {
        color: red;
        font-size: 22px;
        font-weight: bold;
        margin-bottom: 10px;
        text-align: center;
    }

    .boxItemTitleNotice i {
        background: url("/dist/img/jg.png") no-repeat center center;
        height: 22px;
        width: 22px;
        background-size: cover;
        display: inline-block;
        margin-bottom: -3px;
        margin-left: 5px;
    }

    .boxItemTitleNoticeTime {
        color: red;
        font-size: 20px;
        font-weight: bold;
        margin-bottom: 10px;
        text-align: center;
    }

    .boxItemTitleNoticeTime i {
        background: url("/dist/img/jg.png") no-repeat center center;
        height: 16px;
        width: 16px;
        background-size: cover;
        display: inline-block;
        margin-bottom: -3px;
        margin-left: 5px;
    }

    .search-button {
        width: 14px;
        height: 14px;
        background-image: url(/dist/img/glass.jpg);
        border: 0 none;
        cursor: pointer;
        margin-top: 0px;
    }

    input[type=button] {
        outline: none;
    }

    .oaBtn {
        background: url(/dist/img/btn-bj2.png) repeat-y !important;
        background-size: 100% 100% !important;
        color: #fff !important;
    }

    .btn-group-sm > .btn, .btn-sm {
        padding: 2px 10px;
    }

    .btn {
        border-radius: 3px;
        -webkit-box-shadow: none;
        box-shadow: none;
        border: 1px solid transparent;
    }

    .pull-right {
        float: right !important;
    }

    .blue {
        color: #39c;
    }

    .red {
        color: #e03800;
    }

    .weather img {
        height: 30px;
        width: 30px;
        float: left;
    }

    .templateStyle {
        margin-top: 10px;
        margin-left: 10px;
        margin-right: 10px;
    }

    .line {
        border-bottom: 4px solid #2a8cec;
    }

    .tryStyle {
        width: 34px;
        height: 17px;
        line-height: 17px;
        font-size: 12px;
        top: 0px;
        right: -3px;
        position: absolute;
        border-radius: 50px;
        margin-top: 4px;
        background: #ff131c;
        color: #fff;
        margin-right: -2px;
        transform: scale(0.7);
    }

    .qingjia {
        background: url("/dist/img/icon_seal_qingjia.png") no-repeat bottom right;
        background-size: 30%;
    }

    .ht-rili-leftarr, .ht-rili-rightarr {
        display: none;
    }

    .icon-zhankai, .icon-shouqi {
        cursor: pointer;
        border-radius: 5px;
        float: right;
        font-weight: bold;
    }
</style>
<body>
<section class="content" id="app" v-cloak>
    <div class="div-td-content-more"><i></i></div>
    <!--考勤异常报表-->
    <!--  <div class="templateStyle">
          <div class="boxItem" style="padding: 0px;">
              <div class="boxBoy">
                  <table class="table table-bordered text-center table-width">
                      <tbody>
                      <tr>
                          <td colspan="3" style="background-color: #2c8cec;color: white;">
                              <span>考勤异常报表</span>
                              <span style="background: #fff;color: #2a8cec;position: absolute;top: 3px;right: 6px;width: 50px;"
                                    @click="openDetail(userId,attendanceException.arriveLateNum,attendanceException.arriveLateSum,attendanceException.abnormal)">查看</span>
                          </td>
                      </tr>
                      </tbody>
                  </table>
                  <table class="table table-bordered text-center table-width">
                      <tbody>
                      <tr>
                          <td style="width:35%;">迟到时间>10分钟</td>
                          <td style="width: 35%;">迟到次数≥3次</td>
                          <td style="width: 30%;">考勤作假</td>
                      </tr>
                      <tr>
                          <td>{{attendanceException.arriveLateNum}}</td>
                          <td>{{attendanceException.arriveLateSum}}</td>
                          <td>{{attendanceException.abnormal}}</td>
                      </tr>
                      </tbody>
                  </table>
              </div>
              <div class="clear"></div>
          </div>
      </div>-->
    <!--请假报表-->
    <div class="templateStyle">
        <div class="boxItem" style="padding: 0px;">
            <div class="boxBoy">
                <table class="table table-bordered text-center table-width"
                       v-if="signLeaveReportList&&signLeaveReportList.length>0">
                    <tbody>
                    <tr>
                        <td colspan="3" style="text-align: center;" class="tableTitle">
                            <span>本月请假报表</span>
                            <span class="iconfont icon-zhankai" v-if="btn1==0"
                                  @click="btn1=1"></span>
                            <span class="iconfont icon-shouqi" v-if="btn1==1"
                                  @click="btn1=0"></span>
                        </td>
                    </tr>
                    </tbody>
                </table>
                <table class="table table-bordered text-center table-width"
                       v-if="signLeaveReportList&&signLeaveReportList.length>0">
                    <tbody>
                    <tr>
                        <td style="width:50%;">姓名</td>
                        <td>请假天数</td>
                    </tr>
                    <tr v-for="(item,i) in signLeaveReportList" v-if="btn1==0?i<5:signLeaveReportList.length">
                        <td><span class="oa-name">{{item.userName}}</span></td>
                        <td @click="openLeaveDetail(item)" style="color: #2a8cec;cursor: pointer;">{{item.num}}</td>
                    </tr>
                    </tbody>
                </table>
            </div>
            <div class="clear"></div>
        </div>
    </div>
    <div>
        <!--我的考勤-->
        <div class="templateStyle">
            <div style="display:block;text-align: center;line-height: 28px;" class="tableTitle">
                我的考勤
            </div>
            <template v-if="allPlanItem.signState=='1'">
                <div class="calendar-box demo-box" id="demo-box" v-line-inserted2></div>
                <div style="padding:5px 10px;    border: 1px solid rgb(203, 203, 205);">
                    <div style="display: flex">
                        <span> 请假原因：</span>
                        <span style="flex: 1" class="qjyy">{{allPlanItem.address}}</span>
                    </div>
                </div>
            </template>

            <template v-else-if="allPlanItem.signState=='0'">
                <!--正常签到-->
                <img v-if="allPlanItem.signUrl" :src="allPlanItem.signUrl"
                     alt=""
                     style="width: 100%; height: 400px;display: block;border: 1px solid #cbcbcd;margin-top: -1px;object-fit: fill;">
                <div v-if="allPlanItem.signUrl"
                     style="padding:5px 10px;border:  1px solid #cbcbcd;margin-top: -1px;">
                    <div v-if="allPlanItem.frontFlag==1" style="display: flex">
                        <span>常驻地：</span>
                        <span style="flex: 1">{{(allPlanItem.residence).replace(/(^\s+)|(\s+$)/g,"")}}</span>
                    </div>

                    <div style="margin-top: 2px;display: flex">
                        <span><template v-if="allPlanItem.frontFlag==1">
                        签到地：
                        </template>
                        <template v-else>
                            签&nbsp;&nbsp;到&nbsp;&nbsp;地：
                        </template></span>
                        <span style="flex: 1">{{(allPlanItem.address).replace(/(^\s+)|(\s+$)/g,"")}}</span>
                    </div>
                    <span v-if="allPlanItem.frontFlag==1" style="margin-top: 2px;">相&nbsp;&nbsp;&nbsp;&nbsp;距：{{allPlanItem.signInAlwaysDistance}}</span>
                    <span v-if="allPlanItem.frontFlag==1" style="float: right">签到时间：{{new Date(allPlanItem.signCreateTime).Format('hh:mm')}}</span>
                    <span v-else style="margin-top: 2px;">
                        签到时间：{{new Date(allPlanItem.signCreateTime).Format('hh:mm')}}
                    </span>
                </div>
            </template>
            <template v-else>
                <!--缺勤-->
                <div v-if="returnFlag">
                    <div style="text-align: center;background: #ffffff;padding: 30px;border: 1px solid #cbcbcd;border-top: 0px;">
                        <div style="text-align: center">
                            <img width="45%" src="/dist/img/icon_seal_queqin.png">
                        </div>
                    </div>
                </div>
            </template>
        </div>
        <div class="templateStyle" v-if="regionSupportList&&regionSupportList.length>0">
            <div style="display:block;text-align: center;line-height: 28px;" class="tableTitle">
                区域支持
            </div>
            <table class="table table-bordered text-center">
                <tbody>
                <tr>
                    <td class="tdColor" style="width: 20%">大区</td>
                    <td class="tdColor" style="width: 16%">姓名</td>
                    <td class="tdColor" style="width: 25%">签到时间</td>
                    <td class="tdColor" style="width: 40%">签退时间</td>
                </tr>
                <tr v-for="(item,i) in regionSupportList">
                    <td class="lineOne"><span style="text-align: center">{{item.regionName.replace(/大区/g,'')}}</span>
                    </td>
                    <td v-if="item.managerName" @click="openSign(item)"
                        style="color: #2a8cec;cursor: pointer;">
                        <span class="oa-name">{{item.managerName}}</span>
                    </td>
                    <td v-else style="color: rgb(204, 204, 204);"></td>
                    <td>
                        <span v-if="item.signState=='1'">请假</span>
                        <span v-else-if="item.signState=='0'">
                                   <!-- <template
                                            v-if="isSupportLate(item.createTime)">
                                        <span class="tryStyle">迟到</span>
                                    </template>
                                        {{item.createTime.substring(11,16)}}-->
                             <span v-if="isSupportLate(item.createTime)" style="color: red;">{{item.createTime.substring(11,16)}}</span>
                            <span v-else>{{item.createTime.substring(11,16)}}</span>
                                </span>
                        <span v-else-if="item.managerName!=''">缺勤</span>

                    </td>
                    <td  ><span>{{item.leaveTime.substring(11,16)}}</span></td>
                </tr>
                </tbody>
            </table>
        </div>
        <div class="templateStyle" v-if="regionXSZJList&&regionXSZJList.length>0">
            <div style="display:block;text-align: center;line-height: 28px;" class="tableTitle">
                销售总监
            </div>
            <table class="table table-bordered text-center">
                <tbody>
                <tr>
                    <td class="tdColor" style="width: 20%">公司</td>
                    <td class="tdColor" style="width: 16%">姓名</td>
                    <td class="tdColor" style="width: 25%">签到时间</td>
                    <td class="tdColor" style="width: 40%">签退时间</td>
                </tr>
                <tr v-for="(item,i) in regionXSZJList">
                    <td class="lineOne"><span style="text-align: center">{{item.companyName}}</span>
                    </td>
                    <td v-if="item.managerName" @click="openSign(item)"
                        style="color: #2a8cec;cursor: pointer;">
                        <span class="oa-name">{{item.managerName}}</span>
                    </td>
                    <td v-else style="color: rgb(204, 204, 204);"></td>
                    <td>
                        <span v-if="item.signState=='1'">请假</span>
                        <span v-else-if="item.signState=='0'">
                                    <!--<template
                                            v-if="isSupportLate(item.createTime)">
                                        <span class="tryStyle">迟到</span>
                                    </template>
                                        {{item.createTime.substring(11,16)}}-->
                              <span v-if="isSupportLate(item.createTime)" style="color: red;">{{item.createTime.substring(11,16)}}</span>
                            <span v-else>{{item.createTime.substring(11,16)}}</span>
                                </span>

                        <span v-else-if="item.managerName!=''">缺勤</span>

                    </td>
                    <td ><span>{{item.leaveTime.substring(11,16)}}</span></td>
                </tr>
                </tbody>
            </table>
        </div>
        <div class="templateStyle" v-if="regionTopList&&regionTopList.length>0">
            <div style="display:block;text-align: center;line-height: 28px;" class="tableTitle">
                区域总监
            </div>
            <table class="table table-bordered text-center">
                <tbody>
                <tr>
                    <td class="tdColor" style="width: 20%">大区</td>
                    <td class="tdColor" style="width: 16%">姓名</td>
                    <td class="tdColor" style="width: 25%">签到时间</td>
                    <td class="tdColor" style="width: 40%">签到地点</td>
                </tr>
                <tr v-for="(item,i) in regionTopList">
                    <td class="lineOne"><span style="text-align: center">{{item.regionName.replace(/大区/g,'')}}</span>
                    </td>
                    <td v-if="item.managerName" @click="openSign(item)"
                        style="color: #2a8cec;cursor: pointer;">
                        <span class="oa-name">{{item.managerName}}</span>
                    </td>
                    <td v-else style="color: rgb(204, 204, 204);"></td>
                    <td>
                        <span v-if="item.signState=='1'">请假</span>
                        <span v-else-if="item.signState=='0'">
                                  <!--  <template
                                            v-if="isLate(item.createTime)">
                                        <span class="tryStyle">迟到</span>
                                    </template>
                                        {{item.createTime.substring(11,16)}}-->
                              <span v-if="isLate(item.createTime)" style="color: red;">{{item.createTime.substring(11,16)}}</span>
                            <span v-else>{{item.createTime.substring(11,16)}}</span>
                                </span>
                        <span v-else-if="item.managerName!=''">缺勤</span>

                    </td>
                    <td class="lineOne"><span>{{item.address}}</span></td>
                </tr>
                </tbody>
            </table>
        </div>
        <div class="templateStyle">
            <div style="display:block;text-align: center;line-height: 28px;" class="tableTitle">
                大区经理
            </div>
            <table class="table table-bordered text-center">
                <tbody>
                <tr>
                    <td class="tdColor" style="width: 20%">大区</td>
                    <td class="tdColor" style="width: 16%">姓名</td>
                    <td class="tdColor" style="width: 25%">签到时间</td>
                    <td class="tdColor" style="width: 40%">签到地点</td>
                </tr>
                <tr v-for="(item,i) in bigRegionList">
                    <td class="lineOne"><span style="text-align: center">{{item.regionName}}</span>
                    </td>
                    <td v-if="item.managerName" @click="openSign(item)"
                        style="color: #2a8cec;cursor: pointer;">
                        <span class="oa-name">{{item.managerName}}</span>
                    </td>
                    <td v-else style="color: rgb(204, 204, 204);"></td>
                    <td>
                        <span v-if="item.signState=='1'">请假</span>
                        <span v-else-if="item.signState=='0'">
                                    <!--<template
                                            v-if="isLate(item.createTime)">
                                        <span class="tryStyle">迟到</span>
                                    </template>
                                        {{item.createTime.substring(11,16)}}-->
                            <span v-if="isLate(item.createTime)" style="color: red;">{{item.createTime.substring(11,16)}}</span>
                            <span v-else>{{item.createTime.substring(11,16)}}</span>
                                </span>
                        <span v-else-if="item.managerName!=''">缺勤</span>

                    </td>
                    <td class="lineOne"><span>{{item.address}}</span></td>
                </tr>
                </tbody>
            </table>
        </div>
        <div class="templateStyle" v-for="(item,i) in regionListInfo">
            <div style="display:block;text-align: center;line-height: 28px;" class="tableTitle">
                {{item.regionName}}
            </div>
            <table class="table table-bordered text-center">
                <tbody>
                <tr>
                    <td class="tdColor" style="width: 20%">区域</td>
                    <td class="tdColor" style="width: 16%">姓名</td>
                    <td class="tdColor" style="width: 25%">签到时间</td>
                    <td class="tdColor" style="width: 40%">签到地点</td>
                </tr>
                <tr v-for="(item2,i) in regionList" v-if="item2.bigRegionId==item.regionId">
                    <td class="lineOne"><span>{{item2.regionName.replace(/大区/g,'')}}</span></td>
                    <td v-if="item2.managerName" @click="openSign(item2)"
                        style="color: #2a8cec;cursor: pointer;">
                        <span class="oa-name">{{item2.managerName}}</span>
                    </td>
                    <td v-else style="color: rgb(204, 204, 204);"></td>
                    <td>
                        <span v-if="item2.signState=='1'">请假</span>
                        <span v-else-if="item2.signState=='0'">
                           <!-- <template v-if="isLate(item2.createTime)">
                                 <span class="tryStyle">迟到</span>
                            </template>
                             {{item2.createTime.substring(11,16)}}-->
                            <span v-if="isLate(item2.createTime)" style="color: red;">{{item2.createTime.substring(11,16)}}</span>
                            <span v-else>{{item2.createTime.substring(11,16)}}</span>
                        </span>
                        <span v-else-if="item2.managerName!=''">缺勤</span>
                    </td>
                    <td class="lineOne"><span>{{item2.address}}</span></td>
                </tr>
                </tbody>
            </table>
        </div>
        <div class="clear"></div>
    </div>
    <div style="margin-bottom: 15px;"></div>

</section>
<!--JQ-->
<script src="https://file.ggxqce.com/web/jquery-2.2.3.min.js"></script>
<!--插件JS-->
<script src="/dist/plugins/scroll/myScroll.js"></script>
<!--框架已定义 JS-->
<!--oa自定义  JS-->
<script src="/dist/js/oaApp.js"></script>
<script type="text/javascript" src="/dist/plugins/lhgdialog/lhgdialog.min.js?self=true"></script>
<script src="/dist/plugins/calendar/calendar-pro.js"></script>
<script>
    $(function () {
        $("body").on("click", ".lineOne,.lineTwo", function (e) {
            if ($(".div-td-content-more").is(":hidden")) {
                var text = $(this).text();
                if (text != "") {
                    text = "<i></i>" + text;
                    $(".div-td-content-more").html(text).css({
                        "width": $(this).outerWidth() + "px",
                        "left": $(this).offset().left,
                        "top": ($(this).offset().top + $(this).outerHeight()) + "px"
                    }).show();
                    e.stopPropagation();
                }
            } else {
                $(".div-td-content-more").hide();
            }
        });
        $("body").on("click", ".div-td-content-more", function (e) {
            e.stopPropagation();
        });
        $("body").on("click", function () {
            $(".div-td-content-more").hide();
        });
    });
</script>
<script>
    $.ajaxSetup({
        global: true,
        type: "POST",
        cache: false,
        dataType: "json",
        contentType: 'application/json;charset=utf-8',
        beforeSend: function () {
        },
        complete: function () {

        },
        error: function (e) {
            alert('error' + e.responseText);
        }
    });
    $.extend($.wyui, {
        postMethod: function (url, data, callback, sync, id) {
            if (!id) {
                id = "#app"
            }
            $.ajax({
                url: server.ip + url,
                async: sync ? false : true,
                data: JSON.stringify(data),
                beforeSend: function () {

                },
                complete: function () {
                    setTimeout(function () {
                    }, 1000);

                },
                success: function (r) {
                    if (!r.e.code) {
                        callback(r.data.sendData);
                    } else {
                        alert(r.e.desc);
                    }
                },
                error: function (e) {
                    alert(url + e.responseText);
                }
            });
        },
    });
</script>
<script type="text/javascript">
    var app = new Vue({
        el: "#app",
        data: {
            lateTime: '',
            lateTime1: '',
            userId: getUrlParamObj().userId,
            dateTime: getUrlParamObj().dateTime,
            regionId: getUrlParamObj().departId ? getUrlParamObj().departId : '',
            allPlanItem: {},
            returnFlag: false,
            bigRegionList: [],
            regionListInfo: [],
            regionList: [],
            regionTopList: [],
            regionXSZJList: [],
            signLeaveReportList: [],
            btn1: 0,
            regionSupportList: [],
            attendanceException:
                {
                    arriveLateNum: '',
                    arriveLateSum:
                        '',
                    abnormal:
                        '',
                }
            ,
        },
        methods: {
            openDetail: function (userId, arriveLateNum, arriveLateSum, abnormal) {
                var that = this;
                var obj = {
                    type: 'customerList',
                    url: '/reportForm/newManager/signListApp.html?userId=' + userId + '&dateTime=' + that.dateTime + '&arriveLateNum=' + arriveLateNum + '&arriveLateSum=' + arriveLateSum + '&abnormal=' + abnormal,
                    name: '违规详情',
                }
                prompt(JSON.stringify(obj))
            }
            ,
            //合并单元格
            tablesMergeCell: function (list) {
                if (list != undefined && list && list.length > 0) {
                    for (field in list[0]) {
                        var k = 0;
                        while (k < list.length) {
                            list[k][field + 'span'] = 1;
                            list[k][field + 'dis'] = false;
                            for (var i = k + 1; i <= list.length - 1; i++) {
                                if (list[k][field] == list[i][field] && list[k][field] != '') {
                                    list[k][field + 'span']++;
                                    list[k][field + 'dis'] = false;
                                    list[i][field + 'span'] = 1;
                                    list[i][field + 'dis'] = true;
                                } else {
                                    break;
                                }
                            }
                            k = i;
                        }
                    }
                }
                return list;
            }
            ,
            get_signLeaveReport: function () {
                var that = this;
                $.wyui.postMethod("/newAppReportForZSQ/getSignLeaveReportForZSQ.json", {
                    "userId": that.userId,
                    "dateTime": that.dateTime,
                }, function (data) {
                    that.signLeaveReportList = data.result;
                    var obj = {
                        dialog: 'hidden'
                    }
                    prompt(JSON.stringify(obj))
                });
            },
            get_date: function (list) {
                var data;
                var current = [];
                var last = [];
                var next = [];
                var benNian = new Date().Format("yyyy");
                var benYue = new Date().Format("M");
                var lastTime = '';
                var currentTime = new Date().Format("yyyy-MM");
                var today = new Date().Format("yyyy-MM-dd");
                var nextTime = '';
                if (Number(benYue) + 1 > 12) {
                    nextTime = Number(benNian) + 1 + "-01"
                } else if (Number(benYue) + 1 < 10) {
                    nextTime = Number(benNian) + "-0" + (Number(benYue) + 1)
                } else {
                    nextTime = Number(benNian) + "-" + (Number(benYue) + 1)
                }
                if (Number(benYue) - 1 < 1) {
                    lastTime = Number(benNian) - 1 + "-12"
                } else if (Number(benYue) - 1 < 10) {
                    lastTime = Number(benNian) + "-0" + (Number(benYue) - 1)
                } else {
                    lastTime = Number(benNian) + "-" + (Number(benYue) - 1)
                }
                for (var i = 0; i < list.length; i++) {
                    if (lastTime == list[i].leaveDate.substring(0, 7)) {
                        last.push({date: list[i].leaveDate, data: '假', yy: list[i].remark})
                    }
                    if (currentTime == list[i].leaveDate.substring(0, 7)) {
                        if (today == list[i].leaveDate) {
                            current.push({date: list[i].leaveDate, data: '假', today: true, yy: list[i].remark})
                        } else {
                            current.push({date: list[i].leaveDate, data: '假', yy: list[i].remark})
                        }
                    }
                    if (nextTime == list[i].leaveDate.substring(0, 7)) {
                        next.push({date: list[i].leaveDate, data: '假', yy: list[i].remark})
                    }
                }
                data = {
                    last: last,
                    current: current,
                    next: next
                }
                return data

            }
            ,
            openLeaveDetail: function (item) {
                var that = this;
                var obj = {
                    type: 'goDetail',
                    url: '/reportForm/newManager/managerLeaveDetailApp.html?userId=' + item.userId,
                    name: '请假详情',
                }
                console.log(obj)
                prompt(JSON.stringify(obj))
            }
            ,
            getCountDays: function (dateStr) {//返回当月的天数
                var curDate = new Date(dateStr);
                var curMonth = curDate.getMonth();
                curDate.setMonth(curMonth + 1);
                curDate.setDate(0);
                return curDate.getDate();
            }
            ,
            //跳转到详情页
            openSign: function (item) {
                var obj = {
                    type: 'customerList',
                    url: '/reportForm/newManager/managerSignDetailApp.html?userId=' + item.managerId + '&dateTime=' + this.dateTime,
                    name: item.managerName
                }
                prompt(JSON.stringify(obj))
            }
            ,
            getLateTimeByUserIdAndFrontFlag: function () {
                var that = this;
                $.wyui.postMethod(urlConfig.system.signIn.signTimeByUserId, {
                    "userId": that.userId,
                    "frontFlag": '1'
                }, function (data) {
                    that.lateTime = data.signDate;
                });
            }
            ,
            getLateTimeByUserIdAndFrontFlag2: function () {
                var that = this;
                $.wyui.postMethod(urlConfig.system.signIn.signTimeByUserId, {
                    "userId": that.userId,
                    "frontFlag": '0'
                }, function (data) {
                    that.lateTime1 = data.signDate;
                });
            },
            get_signIn: function () {
                var that = this;
                $.wyui.postMethod("/newAppReportForZSQ/getSignByUserIdAndDateTimeForZSQ.json", {
                    "userId": that.userId,
                    "dateTime": that.dateTime,
                }, function (data) {
                    that.bigRegionList = data.records;
                });
            }
            ,
            //获取权限
            get_roleName: function (regionId) {
                var that = this;
                $.wyui.postMethod(urlConfig.newZXQReportForm.getRoleNameByUserId, {
                    "userId": that.userId,
                }, function (data) {
                    var roleName = data.records;
                    if ('区域支持' == roleName || '销售管理' == roleName) {
                        if (server.fwq) {
                            if (server.fwq == "wyp") {
                                switch (roleName) {
                                    case '销售管理':
                                        that.get_quYuZhiChi();
                                    case '区域支持':
                                        that.get_xiaoShouZongJian();
                                        that.get_quYuZongJian();
                                    default:
                                        roleName = '区域总监';
                                }
                            }
                        }else{
                            switch (roleName) {
                                case '销售管理':
                                    that.get_xiaoShouZongJian();
                                    that.get_quYuZhiChi();
                                case '区域支持':
                                    that.get_quYuZongJian();
                                default:
                                    roleName = '区域总监';
                            }
                        }

                    }
                    switch (roleName) {
                        case '总经理':
                            that.get_quYuZongJian();
                        case '销售总监':
                            that.get_quYuZongJian();
                        case '区域总监':
                            that.get_daQu();
                        default :
                            that.get_leaveReason();
                    }
                });

            }
            ,
            //考勤异常
            get_attendanceException: function () {
                var that = this;
                $.wyui.postMethod(urlConfig.newZXQReportForm.getAttendanceExceptionForZSQ, {
                    "userId": that.userId,
                    "dateTime": that.dateTime,
                }, function (data) {
                    that.attendanceException = data;
                });
            }
            ,
            //是否迟到
            isLate: function (dateStr) {
                var that = this;
                dateStr = dateStr.substring(11, 16);

                if (dateStr > that.lateTime) {
                    return true
                } else {
                    return false
                }

            }
            ,
            //是否迟到
            isSupportLate: function (dateStr) {
                var that = this;
                dateStr = dateStr.substring(11, 16);
                if (dateStr > that.lateTime1) {
                    return true
                } else {
                    return false
                }
            }
            ,
            get_daQu: function () {
                var that = this;
                $.wyui.postMethod("/newAppReportForZSQ/getSignByBigUserIdAndDateTimeForZSQ.json", {
                    "userId": that.userId,
                    "dateTime": that.dateTime,
                }, function (data) {
                    var records = data.records;
                    if (records && records.length > 0) {
                        for (var j = 0; j < records.length; j++) {
                            var item1 = records[j];
                            var brmName = item1.brmName && item1.brmName != '' ? '-' + item1.brmName : ''
                            item1.regionName = item1.regionName + brmName;
                        }
                    }
                    that.regionListInfo = records;
                    var nameList = '';
                    var managetList = [];
                    for (var i = 0; i < data.recordsBigRegion.length; i++) {
                        var item = data.recordsBigRegion[i];
                        /* var brmName = item.brmName && item.brmName != '' ? '-' + item.brmName : ''
                         item.regionName = item.regionName + brmName;*/
                        if (nameList.indexOf(item.managerName) == -1 || (item.managerName == "")) {
                            managetList.push(item);
                            nameList += item.managerName;
                        }
                    }
                    that.regionList = managetList;
                    var obj = {
                        dialog: 'hidden'
                    }
                    prompt(JSON.stringify(obj))
                });
            }
            ,
            get_quYuZongJian: function () {
                var that = this;
                $.wyui.postMethod("/newAppReportForZSQ/getSignByUserIdAndDateTimeForTOPZSQ.json", {
                    "userId": that.userId,
                    "dateTime": that.dateTime,
                }, function (data) {
                    // that.regionTopList = data.records;
                    collapseArea(data.records);
                    var obj = {
                        dialog: 'hidden'
                    }
                    prompt(JSON.stringify(obj))
                });
            }
            ,
            get_xiaoShouZongJian: function () {
                var that = this;
                $.wyui.postMethod("/newAppReportForZSQ/getSignByUserIdAndDateTimeForXSZJZSQ.json", {
                    "userId": that.userId,
                    "dateTime": that.dateTime,
                }, function (data) {
                    that.regionXSZJList = data.records;
                    var obj = {
                        dialog: 'hidden'
                    }
                    prompt(JSON.stringify(obj))
                });
            }
            ,
            get_quYuZhiChi: function () {
                var that = this;
                $.wyui.postMethod("/newAppReportForZSQ/getSignByUserIdAndDateTimeForQYZCZSQ.json", {
                    "userId": that.userId,
                    "dateTime": that.dateTime,
                }, function (data) {
                    // that.regionTopList = data.records;
                    collapseAreaSupport(data.records);
                    var obj = {
                        dialog: 'hidden'
                    }
                    prompt(JSON.stringify(obj))
                });
            }
            ,
            //获取请假原因
            get_leaveReason: function () {
                var that = this;
                $.wyui.postMethod("/newAppReportForZSQ/getSignByMyself.json", {
                    "userId": that.userId,
                    "dateTime": that.dateTime,
                }, function (data) {
                    that.allPlanItem = data;
                    that.returnFlag = true;
                });
            }
            ,
            unique: function (arr, field) {
                var map = {};
                var res = [];
                for (var i = 0; i < arr.length; i++) {
                    if (!map[arr[i][field]]) {
                        map[arr[i][field]] = 1;
                        res.push(arr[i]);
                    }
                }
                return res;
            }
        }
        ,
        mounted: function () {
            var that = this;
            var obj = {
                dialog: 'show'
            }
            prompt(JSON.stringify(obj))
            that.getLateTimeByUserIdAndFrontFlag();
            that.get_signIn();
            that.get_roleName();
            that.get_attendanceException();
            that.get_signLeaveReport();
            that.getLateTimeByUserIdAndFrontFlag2();

        }
    })


</script>
<script>
    Vue.directive('line-inserted2', {
        inserted: function (el, binding) {
            showCalendar();
        }
    });

    function showCalendar() {
        var id = "#demo-box";
        $.wyui.postMethod("/newAppReportForZSQ/getCalendar.json", {
            "userId": app.userId,
            "dateTime": new Date().Format("yyyy-MM"),
        }, function (data) {
            var res = app.get_date(data)
            $(id).calendar({
                ele: id, //依附
                title: '',
                data: res
            });
        });

    }

</script>
<script>
    function collapseArea(list) {
        var noRepeatList = []
        var userIdStr = app.userId
        for (var i = 0; i < list.length; i++) {
            if (userIdStr.indexOf(list[i].managerId) < 0 || list[i].managerId == "") {
                noRepeatList.push(list[i])
                userIdStr += list[i].managerId
            }
        }
        for (var i = 0; i < noRepeatList.length; i++) {
            for (var j = 0; j < list.length; j++) {
                if (noRepeatList[i].managerId == list[j].managerId
                    && noRepeatList[i].regionName.indexOf(list[j].regionName) < 0
                    && noRepeatList[i].managerId != "") {
                    noRepeatList[i].regionName = noRepeatList[i].regionName + "/" + list[j].regionName
                }
            }
        }
        app.regionTopList = app.tablesMergeCell(noRepeatList);

    }
</script>
<script>
    function collapseAreaSupport(list) {
        var noRepeatList = []
        var userIdStr = app.userId
        for (var i = 0; i < list.length; i++) {
            if (userIdStr.indexOf(list[i].managerId) < 0 || list[i].managerId == "") {
                noRepeatList.push(list[i])
                userIdStr += list[i].managerId
            }
        }
        for (var i = 0; i < noRepeatList.length; i++) {
            for (var j = 0; j < list.length; j++) {
                if (noRepeatList[i].managerId == list[j].managerId
                    && noRepeatList[i].regionName.indexOf(list[j].regionName) < 0
                    && noRepeatList[i].managerId != "") {
                    noRepeatList[i].regionName = noRepeatList[i].regionName + "/" + list[j].regionName
                }
            }
        }
        app.regionSupportList = app.tablesMergeCell(noRepeatList);
    }
</script>
</body>
</html>